<template>
    <p>这是一个home页</p>
    <p>js跳转</p>
    <button @click="pushstr">字符串-跳转</button>
    <button @click="pushPath">puah-oath跳转</button>
    <button @click="pushPathQuery">push-路径-query-跳转</button>
    <button @click="pushNameParams">push-命名路由-参数-跳转</button>
</template>

<script>
export default{
    methods:{
        pushstr(){
            this.$router.push("/about")
        },
        pushstr(){
            this.$router.push({path:"/about"})
        }
    },
   
    pushNameParams(){
        this.$router.push({name:'about',state:{param:{id:2,name:'tom'}}}
        )
    },
    pushPathQuery(){
        this.$router.push({name:'about',query:{id,name:'tom'}})
    },
    mounted(){
        console.log('this.$roule',this.$route);
        console.log('this.$rouler',this.$router);
    }

}</script>